package com.lizardmind.haofudoctor.other.js

import android.util.Log
import android.webkit.JavascriptInterface
import com.linxiao.framework.util.ke

/**获取分享的js
 * Created by Extends on 2017/1/20.
 */
class ShareJS {
    var title: String? = null
        @JavascriptInterface
        set(s) {
            field = s
        }
    @set:JavascriptInterface
    var synopsis: String? = null
    var imgUrl: String? = null
        private set

    @JavascriptInterface
    fun setImage(s: String) {
        imgUrl = s
    }

    @JavascriptInterface
    fun setShareJS(s: Array<String>) {
        if (s.size < 3) return
        title = s[0]
        setImage(s[1])
        synopsis = s[2]
        ke("ShareJS通讯成功")
    }
}
